<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "goods_detail".
 *
 * @property string $goods_detail_id
 * @property integer $goods_id
 * @property string $goods_code
 * @property string $goods_name
 * @property integer $goods_type_id
 * @property string $goods_key
 * @property double $cost_price
 * @property double $stock_price
 * @property double $market_price
 * @property double $goods_kg
 * @property integer $goods_supply_id
 * @property integer $register_date
 * @property integer $update_date
 * @property string $produce_date
 * @property integer $period_day
 * @property string $q_index
 * @property integer $buy_number
 * @property integer $limit_start_date
 * @property integer $limit_end_date
 * @property integer $is_gift
 * @property string $storageno
 * @property string $taxrate
 * @property integer $dealkind
 * @property string $deductrate
 * @property string $barcode
 * @property string $stockunit
 * @property string $orderunit
 * @property string $pcsqty
 * @property string $ordqtypit
 * @property string $minstockqty
 * @property string $maxstockqty
 * @property integer $goods_kind
 * @property integer $upv_time
 * @property integer $lock_sales_num
 * @property integer $goods_stock_total
 * @property string $qr_code_pic
 */
class GoodsDetail extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'd_try.goods_detail';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['free_post', 'goods_id', 'goods_type_id', 'goods_supply_id', 'register_date', 'update_date', 'period_day', 'buy_number', 'limit_start_date', 'limit_end_date', 'is_gift', 'dealkind', 'goods_kind', 'upv_time', 'lock_sales_num', 'goods_stock_total'], 'integer'],
            [['cost_price', 'stock_price', 'market_price', 'goods_kg', 'taxrate', 'deductrate', 'pcsqty', 'ordqtypit', 'minstockqty', 'maxstockqty'], 'number'],
            [['produce_date'], 'required'],
            [['produce_date'], 'safe'],
            [['goods_code', 'goods_key'], 'string', 'max' => 30],
            [['goods_name'], 'string', 'max' => 40],
            [['q_index'], 'string', 'max' => 50],
            [['storageno', 'stockunit', 'orderunit'], 'string', 'max' => 20],
            [['barcode'], 'string', 'max' => 100],
            [['qr_code_pic'], 'string', 'max' => 255],
            [['goods_id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'goods_detail_id' => 'Goods Detail ID',
            'goods_id' => 'Goods ID',
            'goods_code' => 'Goods Code',
            'goods_name' => '商品名称',
            'goods_type_id' => 'Goods Type ID',
            'goods_key' => 'Goods Key',
            'cost_price' => 'Cost Price',
            'stock_price' => 'Stock Price',
            'market_price' => 'Market Price',
            'goods_kg' => 'Goods Kg',
            'goods_supply_id' => 'Goods Supply ID',
            'register_date' => 'Register Date',
            'update_date' => 'Update Date',
            'produce_date' => 'Produce Date',
            'period_day' => 'Period Day',
            'q_index' => 'Q Index',
            'buy_number' => 'Buy Number',
            'limit_start_date' => 'Limit Start Date',
            'limit_end_date' => 'Limit End Date',
            'is_gift' => 'Is Gift',
            'storageno' => 'Storageno',
            'taxrate' => 'Taxrate',
            'dealkind' => 'Dealkind',
            'deductrate' => 'Deductrate',
            'barcode' => 'Barcode',
            'stockunit' => 'Stockunit',
            'orderunit' => 'Orderunit',
            'pcsqty' => 'Pcsqty',
            'ordqtypit' => 'Ordqtypit',
            'minstockqty' => 'Minstockqty',
            'maxstockqty' => 'Maxstockqty',
            'goods_kind' => 'Goods Kind',
            'upv_time' => 'Upv Time',
            'lock_sales_num' => 'Lock Sales Num',
            'goods_stock_total' => 'Goods Stock Total',
            'qr_code_pic' => 'Qr Code Pic',
            'free_post' => '免邮',
        ];
    }
}
